{%- if include.params.name -%}
  {%- assign name = include.params.name -%}
{%- endif -%}

{%- if page[name] != nil -%}
  {%- assign return = page[name] -%}
{%- elsif site[name] != nil -%}
  {%- assign return = site[name] -%}
{%- elsif site.data[name] != nil -%}
  {%- assign return = site.data[name] -%}
{%- elsif site.defaults[page.layout][name] != nil -%}
  {%- assign return = site.defaults[page.layout][name] -%}
{%- elsif site.data.defaults[page.layout][name] != nil -%}
  {%- assign return = site.data.defaults[page.layout][name] -%}
{%- elsif layout[name] != nil -%}
  {%- assign return = layout[name] -%}
{%- else -%}
  {%- assign return = include.params.default -%}
{%- endif -%}
